package com.flw.eslab.dto;

import com.flw.eslab.model.Group;
import com.flw.eslab.model.Role;
import com.flw.eslab.model.User;



public class User_Dto {
	private Integer id;
	private String studentNO;
	private String name;
	private String position;
	private String passwordOld;
	private String password;
	private String passwordRepeat;
	private Integer groupId;
	private Integer roleId;
	private String state;//当前工作
	
	public User_Dto(){
		
	}
	public User_Dto(int i) {
		this.id=id;
	}
	public boolean checkAddPasswordEqual(){
		if(password!=null&&password.equals(passwordRepeat))
			return true;
		return false;
	}
	public String getPasswordOld() {
		return passwordOld;
	}
	public void setPasswordOld(String passwordOld) {
		this.passwordOld = passwordOld;
	}
	public User toUser(){
		User user=new User();
		user.setId(id);
		user.setName(name);
		user.setPassword(password);
		user.setPosition(position);
		user.setState(state);
		Group group=new Group();
		group.setId(groupId);
		user.setGroup(group);
		Role role=new Role();
		role.setId(roleId);
		user.setRole(role);
		return user;
		}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getStudentNO() {
		return studentNO;
	}
	public void setStudentNO(String studentNO) {
		this.studentNO = studentNO;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getPasswordRepeat() {
		return passwordRepeat;
	}
	public void setPasswordRepeat(String passwordRepeat) {
		this.passwordRepeat = passwordRepeat;
	}
	public Integer getGroupId() {
		return groupId;
	}
	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}
	public Integer getRoleId() {
		return roleId;
	}
	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
}